from dataclasses import dataclass
import torch

@dataclass
class Configuration:
    # Model
    model = "dinov2_vitb14_MixVPR"
    # backbone
    backbone_arch = "dinov2_vitb14"
    pretrained = False  # False：patch embed 卷积模块 和 blocks 参数更新，True:patch embed 卷积模块 参数不更新 和 blocks 由layer1定义更新参数层数
    layer1 = -2
    img_size: int = 448

    # Aggregator 聚合方法
    agg_arch = "MixVPR"  # CosPlace, NetVLAD, GeM
    agg_config = {
        "in_channels": 768,
        "in_h": 32,  # 受输入图像尺寸的影响
        "in_w": 32,
        "out_channels": 1024,
        "mix_depth": 2,
        "mlp_ratio": 1,
        "out_rows": 4,
    }

    # Eval
    batch_size_eval: int = 2

    # Checkpoint
    checkpoint_start = r'weights_e5_98.9714.pth'
    h5py_base_path = r'E:\datasets\satgeoloc_dataset'

    # set num_workers to 0 if on Windows
    num_workers: int = 0
    crop_top_k = 1

    # train on GPU if available
    device: str = "cuda" if torch.cuda.is_available() else "cpu"

    # -----------------------Align_images2.py--------------------------
    # rotate num
    nrotate= 12
    al_crop_folder = './reference_image'
    sp_config_filename = './config.yaml'
